{% extends "base_worklist.html" %}
{% load work_custom_filters %} 
{%block title%}
{{s.aciklama}} (içerik)
{%endblock%}

{% load adminmedia %}

{%block content%}

{{form.media}}

{% if saveasform %}
	<div style="width:1000px; margin-left: auto; margin-right: auto;">
	<fieldset class="module aligned ">
		{% if tuketim_id %}
			<form action="/worklist/hastane/tuketim/{{tuketim_id}}/kaydet/" method="POST">
		{% else %}
			<form action="/worklist/hastane/tuketim/olustur/kaydet/" method="POST">
		{% endif %}
			<div class="form-row category  "> 
				<table style="width: 1000px;">
				<caption class="section">Tüketim Formu&nbsp;</caption>
				<tbody>
					<tr>
						<th>Tarih</th>
						<th>Açıklama</th>
						<th>Fatura</th>
						<th>Onay Durum</th>
					</tr>
					<tr style="white-space: nowrap; vertical-align: middle;">
		       			<td>{{tuketimform.tarih}}&nbsp;<a href="javascript:NewCssCal('id_tarih','yyyymmdd','arrow',false,24,false)"><img src="/media/images/cal.gif" width="16" height="16" alt="Tarih seçiniz"></a>{% if tuketimform.tarih.errors %}<small>{{tuketimform.tarih.errors}}</small>{%endif%}</td>  
		       			<td>{{tuketimform.aciklama}}{% if tuketimform.aciklama.errors %}<small>{{tuketimform.aciklama.errors}}</small>{%endif%}</td>
		       			<td>{{tuketimform.fatura}}{% if tuketimform.fatura.errors %}<small>{{tuketimform.fatura.errors}}</small>{%endif%}</td>
		       			<td>{{tuketimform.onaylandi}}{% if tuketimform.onaylandi.errors %}<small>{{tuketimform.onaylandi.errors}}</small>{%endif%}</td>
	      			</tr>
	      			
	      			{% if tuketim_id %}
	      				{% for kay in tuketim_instance.kayit.all %}
	      					<tr>
	      						<td>{{kay.tuketimnoktasi}}:{{kay.deger}}</td>
	      					</tr>
	      				{% endfor %}
	      			{% endif %}
				</tbody>
				</table>
			</div>
		
			<div class="form-row category  "> 
			
				<table style="width: 1000px;">
				<caption class="section">Bakım Noktaları</caption>
				<tbody>
				
				  <tr style="white-space: nowrap; vertical-align: middle;">
				  	<td><b><select name="tuketimnoktasi" id="id_tuketimnoktasi">{% for nod in tuketimnodz %}<option value="{{nod.id}}">{{nod.aciklama}} ({{nod.birim.aciklama}})</option>{% endfor %}</select>&nbsp;:</b>&nbsp;<input id="id_tuketim_deger" name="tuketim_deger" size="10"/>&nbsp;<input type="image" src="/media/images/add_object.png" alt="Ekle"/></td>
				  </tr>
				
				</tbody>
				</table>
			</div>	
		    
		</form>
			
	</fieldset>
	</div>

{%endif%}
{% if showform %}
	<div style="width:1000px; margin-left: auto; margin-right: auto;">
	<fieldset class="module aligned ">
		
			<div class="form-row category  "> 
				<table style="width: 600px;">
				<caption class="section">Tüketim Noktaları</caption>
				<tbody>
				   <tr>
				   	<td><a href="/worklist/hastane/tuketim/olustur/">Yeni</a></td>
				   </tr>
				{% if tuketimtablolari %}
				{% for t_tablo in tuketimtablolari %}  
				  <tr style="white-space: nowrap; vertical-align: middle;">
				  	<td><b>{{t_tablo.aciklama}}</b></td>
				  </tr>
				{% endfor %}
				
				{%endif %}
				</tbody>
				</table>
			</div>	
		    
	</fieldset>
	</div>
{% endif %}	

{%endblock%}
{% block script %}

{% endblock %}